package Kuaishou;

import java.util.List;
import java.util.stream.Collectors;

import org.apache.commons.compress.utils.Lists;

/**
 * @author leiwenkang <leiwenkang@kuaishou.com>
 * Created on 2020-11-03
 */
public class Test11函数式编程 {
    public static void main(String[] args) {
        List<Integer> list1 = Lists.newArrayList();
        list1.add(1);
        list1.add(2);
        list1.add(3);
        list1.add(4);
        list1.add(5);
        list1.add(6);

        List<Integer> list2 = list1.stream().filter(num -> num > 3).collect(Collectors.toList());

        System.out.println(list1);
        System.out.println(list2);

    }
}
